<%@ page import="rcfirewall.conexaoBD"%>
<%@ page import="rcfirewall.verificaPorta"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Softpar Firewall</title>
</head>
<body>
<%
String service = request.getParameter("service");
String port = request.getParameter("port");
conexaoBD bd = new conexaoBD();
verificaPorta p = new verificaPorta();

if (p.validaPorta(port) == true){
	bd.insertBD("insert into PORT_NUMBER (port,service_name) value (\'" + port + "\',\'" + service + "\')");
	out.println("Porta adicionada com sucesso");
}else{
	out.println("Porta Inválida");
	out.println("<br></br>");
	out.println("O valor deve estar entre 1 e 65535.");
}
%>

</body>
</html>